use zero2prod::{
    configuration::{get_configuration, Settings},
    startup::Application,
    telemetry::{get_subscriber, init_subscriber},
};
#[actix_web::main]
async fn main() -> std::io::Result<()> {
    init_subscriber(get_subscriber(
        "newsletter".into(),
        "info".into(),
        std::io::stdout,
    ));
    let configuration: Settings = get_configuration().expect("Failed to  read configuration.");
    let application = Application::build(configuration).await?;
    application.run_until_stopped().await?;
    Ok(())
}
